package com.weimob.cloud.api.shop.rsp;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * 微盟售后订单详情
 */
@Getter
@Setter
public class WeimobShopAfterSalesDetailRsp implements Serializable {

    @JsonProperty("rightsInfo")
    private RightsInfoDTO rightsInfo;

    @Data
    public static class RightsInfoDTO implements Serializable {

        @JsonProperty("rightsItems")
        private List<RightsItemsDTO> rightsItems;

        @JsonProperty("rightsOrder")
        private RightsOrderDTO rightsOrder;

        @JsonProperty("buyerInfo")
        private BuyerInfoDTO buyerInfo;

        @JsonProperty("originOrder")
        private OriginOrderDTO originOrder;

        @JsonProperty("refundDetail")
        private RefundDetailDTO refundDetail;

        @JsonProperty("refuseInfo")
        private RefuseInfoDTO refuseInfo;

        @JsonProperty("returnOrder")
        private ReturnOrderDTO returnOrder;

        @JsonProperty("rightsReason")
        private RightsReasonDTO rightsReason;

        @JsonProperty("exchangeOrder")
        private ExchangeOrderDTO exchangeOrder;

        @Data
        public static class RightsOrderDTO implements Serializable {

            /**
             * 退款类型
             * 枚举值
             * 1-线上退款；2-线下退款；99-无需退款
             */
            @JsonProperty("refundType")
            private Integer refundType;

            /**
             * 售后状态
             * 枚举值
             * 1-买家发起售后；2-等待买家退货；3-买家已退货；5-系统退款中；6-售后完成；7-买家已取消；8-商家已拒绝；9-退款失败；10-商家退款中；20-换货中；30-商家拒绝_待平台介入；31-待平台介入_仲裁中
             */
            @JsonProperty("rightsStatus")
            private Integer rightsStatus;

            /**
             * 售后类型
             * 枚举值
             * 1-退货退款；2-退款；5-退换货
             */
            @JsonProperty("rightsType")
            private Integer rightsType;

            @JsonProperty("rightsId")
            private Long rightsId;

            /**
             * 申请时间
             */
            @JsonProperty("createTime")
            private Long createTime;

            /**
             * 更新时间，时间戳，毫秒级。
             */
            @JsonProperty("updateTime")
            private Long updateTime;

            @JsonProperty("currency")
            private String currency;

            @JsonProperty("rightsCauseType")
            private Integer rightsCauseType;

            @JsonProperty("rightsSource")
            private Integer rightsSource;
        }

        @Data
        public static class BuyerInfoDTO implements Serializable {

            @JsonProperty("wid")
            private Long wid;

            @JsonProperty("userNickName")
            private String userNickName;

            @JsonProperty("memberBenefits")
            private List<MemberBenefitsDTO> memberBenefits;

            @Data
            public static class MemberBenefitsDTO implements Serializable {

                @JsonProperty("benefitType")
                private Integer benefitType;
            }
        }

        @Data
        public static class OriginOrderDTO implements Serializable {

            @JsonProperty("orderType")
            private Integer orderType;

            @JsonProperty("orderSource")
            private Integer orderSource;

            @JsonProperty("orderNo")
            private Long orderNo;

            @JsonProperty("payType")
            private Integer payType;

            @JsonProperty("channelType")
            private Integer channelType;

            @JsonProperty("outOrderNo")
            private String outOrderNo;

            @JsonProperty("bizSourceType")
            private Integer bizSourceType;

            @JsonProperty("applyOrderStatus")
            private Integer applyOrderStatus;
        }

        @Data
        public static class RefundDetailDTO implements Serializable {

            @JsonProperty("applyAmountInfos")
            private List<ApplyAmountInfosDTO> applyAmountInfos;

            @JsonProperty("refundAmountInfos")
            private List<RefundAmountInfosDTO> refundAmountInfos;

            @JsonProperty("applyAmount")
            private String applyAmount;

            @JsonProperty("refundAmount")
            private String refundAmount;

            @Data
            public static class ApplyAmountInfosDTO implements Serializable {

                @JsonProperty("amount")
                private String amount;

                @JsonProperty("type")
                private Integer type;
            }

            @Data
            public static class RefundAmountInfosDTO implements Serializable {

                @JsonProperty("amount")
                private String amount;

                @JsonProperty("type")
                private Integer type;
            }
        }

        @Data
        public static class RefuseInfoDTO implements Serializable {

            @JsonProperty("refusedReason")
            private String refusedReason;
        }

        @Data
        public static class ReturnOrderDTO implements Serializable {

            @JsonProperty("receiverAddress")
            private String receiverAddress;

            @JsonProperty("receiverPhone")
            private String receiverPhone;

            @JsonProperty("deliveryCompanyCode")
            private String deliveryCompanyCode;

            @JsonProperty("deliveryMethod")
            private Integer deliveryMethod;

            @JsonProperty("receiverName")
            private String receiverName;

            @JsonProperty("deliveryNo")
            private String deliveryNo;

            @JsonProperty("deliveryType")
            private Integer deliveryType;

            @JsonProperty("deliveryCompany")
            private String deliveryCompany;

            @JsonProperty("deliveryStatus")
            private Integer deliveryStatus;
        }

        @Data
        public static class RightsReasonDTO implements Serializable {

            @JsonProperty("reasonImageUrls")
            private List<String> reasonImageUrls;

            @JsonProperty("rightsRemark")
            private String rightsRemark;

            @JsonProperty("rightsReason")
            private String rightsReason;
        }

        @Data
        public static class ExchangeOrderDTO implements Serializable {

            @JsonProperty("orderNo")
            private Long orderNo;

            @JsonProperty("orderItems")
            private List<OrderItemsDTO> orderItems;

            @Data
            public static class OrderItemsDTO implements Serializable {

                @JsonProperty("orderItemId")
                private Long orderItemId;

                @JsonProperty("goodsInfo")
                private GoodsInfoDTO goodsInfo;

                @Data
                public static class GoodsInfoDTO implements Serializable {

                    @JsonProperty("goodsAbilities")
                    private List<GoodsAbilitiesDTO> goodsAbilities;

                    @JsonProperty("labelInfos")
                    private List<LabelInfosDTO> labelInfos;

                    @JsonProperty("goodsId")
                    private Long goodsId;

                    @JsonProperty("rightsServiceType")
                    private Integer rightsServiceType;

                    @JsonProperty("skuBarCode")
                    private String skuBarCode;

                    @JsonProperty("skuAttrInfo")
                    private String skuAttrInfo;

                    @JsonProperty("goodsType")
                    private Integer goodsType;

                    @JsonProperty("subGoodsType")
                    private Integer subGoodsType;

                    @JsonProperty("price")
                    private String price;

                    @JsonProperty("productInfos")
                    private List<ProductInfosDTO> productInfos;

                    @JsonProperty("imageUrl")
                    private String imageUrl;

                    @JsonProperty("bizInfos")
                    private List<BizInfosDTO> bizInfos;

                    @JsonProperty("goodsTitle")
                    private String goodsTitle;

                    @JsonProperty("goodsCode")
                    private String goodsCode;

                    @JsonProperty("skuCode")
                    private String skuCode;

                    @JsonProperty("skuId")
                    private Long skuId;

                    @JsonProperty("skuNum")
                    private String skuNum;

                    @Data
                    public static class GoodsAbilitiesDTO implements Serializable {

                        @JsonProperty("abilityType")
                        private Integer abilityType;

                        @JsonProperty("abilityCode")
                        private String abilityCode;

                        @JsonProperty("bizId")
                        private Long bizId;
                    }

                    @Data
                    public static class LabelInfosDTO implements Serializable {

                        @JsonProperty("labelType")
                        private String labelType;
                    }

                    @Data
                    public static class ProductInfosDTO implements Serializable {

                        @JsonProperty("itemSkuQuantity")
                        private Integer itemSkuQuantity;

                        @JsonProperty("price")
                        private BigDecimal price;

                        @JsonProperty("combSkuId")
                        private Long combSkuId;

                        @JsonProperty("combTitle")
                        private String combTitle;

                        @JsonProperty("title")
                        private String title;

                        @JsonProperty("warehouseInfos")
                        private List<WarehouseInfosDTO> warehouseInfos;

                        @JsonProperty("productType")
                        private Integer productType;

                        @Data
                        public static class WarehouseInfosDTO implements Serializable {

                            @JsonProperty("quantity")
                            private Integer quantity;

                            @JsonProperty("warehouseId")
                            private Long warehouseId;

                            @JsonProperty("warehouseType")
                            private String warehouseType;

                            @JsonProperty("warehouseName")
                            private String warehouseName;
                        }
                    }

                    @Data
                    public static class BizInfosDTO implements Serializable {

                        @JsonProperty("subBizType")
                        private Integer subBizType;

                        @JsonProperty("bizType")
                        private Integer bizType;

                        @JsonProperty("bizOrderId")
                        private String bizOrderId;

                        @JsonProperty("bizId")
                        private Long bizId;
                    }
                }
            }
        }

        @Data
        public static class RightsItemsDTO implements Serializable {

            @JsonProperty("goodsReceiveType")
            private Integer goodsReceiveType;

            @JsonProperty("returnNum")
            private String returnNum;

            @JsonProperty("orderItemId")
            private Long orderItemId;

            @JsonProperty("rightsAssets")
            private List<RightsAssetsDTO> rightsAssets;

            @JsonProperty("refundDetail")
            private RefundDetailDTO refundDetail;

            @JsonProperty("applyNum")
            private String applyNum;

            @JsonProperty("goodsInfo")
            private GoodsInfoDTO goodsInfo;

            @JsonProperty("rightsItemId")
            private Long rightsItemId;

            @Data
            public static class RefundDetailDTO implements Serializable {

                @JsonProperty("applyAmountInfos")
                private List<ApplyAmountInfosDTO> applyAmountInfos;

                @JsonProperty("refundAmountInfos")
                private List<RefundAmountInfosDTO> refundAmountInfos;

                @JsonProperty("applyAmount")
                private String applyAmount;

                @JsonProperty("refundAmount")
                private String refundAmount;

                @Data
                public static class ApplyAmountInfosDTO implements Serializable {

                    @JsonProperty("amount")
                    private String amount;

                    @JsonProperty("type")
                    private Integer type;
                }

                @Data
                public static class RefundAmountInfosDTO implements Serializable {

                    @JsonProperty("amount")
                    private String amount;

                    @JsonProperty("type")
                    private Integer type;
                }
            }

            @Data
            public static class GoodsInfoDTO implements Serializable {

                @JsonProperty("goodsAbilities")
                private List<GoodsAbilitiesDTO> goodsAbilities;

                @JsonProperty("labelInfos")
                private List<LabelInfosDTO> labelInfos;

                @JsonProperty("goodsId")
                private Long goodsId;

                @JsonProperty("rightsServiceType")
                private Integer rightsServiceType;

                @JsonProperty("skuBarCode")
                private String skuBarCode;

                @JsonProperty("skuAttrInfo")
                private String skuAttrInfo;

                @JsonProperty("goodsType")
                private Integer goodsType;

                @JsonProperty("subGoodsType")
                private Integer subGoodsType;

                @JsonProperty("price")
                private String price;

                @JsonProperty("productInfos")
                private List<ProductInfosDTO> productInfos;

                @JsonProperty("imageUrl")
                private String imageUrl;

                @JsonProperty("bizInfos")
                private List<BizInfosDTO> bizInfos;

                @JsonProperty("goodsTitle")
                private String goodsTitle;

                @JsonProperty("goodsCode")
                private String goodsCode;

                @JsonProperty("skuCode")
                private String skuCode;

                @JsonProperty("skuId")
                private Long skuId;

                @JsonProperty("skuNum")
                private String skuNum;

                @Data
                public static class GoodsAbilitiesDTO implements Serializable {

                    @JsonProperty("abilityType")
                    private Integer abilityType;

                    @JsonProperty("abilityCode")
                    private String abilityCode;

                    @JsonProperty("bizId")
                    private Long bizId;
                }

                @Data
                public static class LabelInfosDTO implements Serializable {

                    @JsonProperty("labelType")
                    private String labelType;
                }

                @Data
                public static class ProductInfosDTO implements Serializable {

                    @JsonProperty("itemSkuQuantity")
                    private Integer itemSkuQuantity;

                    @JsonProperty("price")
                    private BigDecimal price;

                    @JsonProperty("combSkuId")
                    private Long combSkuId;

                    @JsonProperty("combTitle")
                    private String combTitle;

                    @JsonProperty("title")
                    private String title;

                    @JsonProperty("warehouseInfos")
                    private List<WarehouseInfosDTO> warehouseInfos;

                    @JsonProperty("productType")
                    private Integer productType;

                    @Data
                    public static class WarehouseInfosDTO implements Serializable {

                        @JsonProperty("quantity")
                        private Integer quantity;

                        @JsonProperty("warehouseId")
                        private Long warehouseId;

                        @JsonProperty("warehouseType")
                        private String warehouseType;

                        @JsonProperty("warehouseName")
                        private String warehouseName;
                    }
                }

                @Data
                public static class BizInfosDTO implements Serializable {

                    @JsonProperty("subBizType")
                    private Integer subBizType;

                    @JsonProperty("bizType")
                    private Integer bizType;

                    @JsonProperty("bizOrderId")
                    private String bizOrderId;

                    @JsonProperty("bizId")
                    private Long bizId;
                }
            }

            @Data
            public static class RightsAssetsDTO implements Serializable {

                @JsonProperty("assetsNum")
                private String assetsNum;

                @JsonProperty("assetsType")
                private Integer assetsType;

                @JsonProperty("assetsTarget")
                private Integer assetsTarget;

                @JsonProperty("assetsAmount")
                private String assetsAmount;
            }
        }
    }
}
